package main.java.LeetCode.ClassicalAlgorithm.Graph;


import main.java.LeetCode.ClassicalAlgorithm.Graph.Impl.LinkedGraph;
import main.java.LeetCode.ClassicalAlgorithm.Graph.Impl.UnionFind;

import java.lang.management.GarbageCollectorMXBean;

public class Main {
    public static void main(String[] args) {
        UnionFind<Integer> unionFind = new UnionFind<>();
        unionFind.union(1,5);
        unionFind.union(2,5);

        unionFind.union(4,6);
        unionFind.union(3,6);

        unionFind.union(5,6);

        System.out.println(unionFind.isConnected(1, 4));

        System.out.println(unionFind.getParent(5));
    }
}
